package main

import "fmt"

// int加法
func addInt(a int, b int) int {
	return a + b
}

// 获取map中key对应的value
func getByKey(m map[string]string, k string) (v string, ok bool) {
	v, ok = m[k]
	return v, ok
}

func main() {
	res := addInt(1, 2)
	fmt.Println(res) // 3

	m := map[string]string{"a": "A"}
	v, ok := getByKey(m, "a")
	fmt.Println(v, ok) // A true

	v, ok = getByKey(m, "b")
	fmt.Println(v, ok) // "" false
}
